

xml = Builder::XmlMarkup.new
xml.chart(:Caption=>caption, \
		  	:canvasBgColor=>'EFEFEF', \
			:showValues=>'1', \
 			:canvasborderlalpha=>'0', \
			:bgcolor=>'FFFFFF', \
			:borderalpha=>'0', \
			:legendShadow=>'0', \
			:legendborderalpha=>'0', \
 			:legendIconScale=>'1', \
 			:legendPosition=>'bottom', \
 			:showPlotBorder=>'0', \
 			:numdivlines=>'0', \
 			:numvdivlines=>'0', \
 			:hdivlinealpha=>'0', \
 			:vdivlinealpha=>'0', \
 			:canvasbgColor=>'FFFFFF', \
 			:legendScaleLineColor=>'AD0000') do

	# Run a loop to create the <rows> tags within <rows>
  xml.rows do
		xml.row(:id=>'Mon', :Label=>'Mon')
		xml.row(:id=>'Tue', :Label=>'Tue')
		xml.row(:id=>'Wed', :Label=>'Wed')
		xml.row(:id=>'Thu', :Label=>'Thu')
		xml.row(:id=>'Fri', :Label=>'Fri')
		xml.row(:id=>'Sat', :Label=>'Sat')
		xml.row(:id=>'Sun', :Label=>'Sun')

	end

	# Run a loop to create the <columns> tags within <columns>
  xml.columns do
		xml.column(:id=>'hour00', :Label=>'12-1 AM')
		xml.column(:id=>'hour01', :Label=>'1-2 AM')
		xml.column(:id=>'hour02', :Label=>'2-3 AM')
		xml.column(:id=>'hour03', :Label=>'3-4 AM')
		xml.column(:id=>'hour04', :Label=>'4-5 AM')
		xml.column(:id=>'hour05', :Label=>'5-6 AM')
		xml.column(:id=>'hour06', :Label=>'6-7 AM')
		xml.column(:id=>'hour07', :Label=>'7-8 AM')
		xml.column(:id=>'hour08', :Label=>'8-9 AM')
		xml.column(:id=>'hour09', :Label=>'9-10 AM')
		xml.column(:id=>'hour10', :Label=>'10-11 AM')
		xml.column(:id=>'hour11', :Label=>'11-12 AM')
		xml.column(:id=>'hour12', :Label=>'12-1 PM')
		xml.column(:id=>'hour13', :Label=>'1-2 PM')
		xml.column(:id=>'hour14', :Label=>'2-3 PM')
		xml.column(:id=>'hour15', :Label=>'3-4 PM')
		xml.column(:id=>'hour16', :Label=>'4-5 PM')
		xml.column(:id=>'hour17', :Label=>'5-6 PM')
		xml.column(:id=>'hour18', :Label=>'6-7 PM')
		xml.column(:id=>'hour19', :Label=>'7-8 PM')
		xml.column(:id=>'hour20', :Label=>'8-9 PM')
		xml.column(:id=>'hour21', :Label=>'9-10 PM')
		xml.column(:id=>'hour22', :Label=>'10-11 PM')
		xml.column(:id=>'hour23', :Label=>'11-12 PM')
	end

	# Run a loop to create the <set> tags within dataset for series 'R-factor'
  xml.dataset do
		for item in arr_data
			xml.set(:rowId => item[0][0], :columnId=>item[0][1], :value=>item[1])
		end

	end

  xml.colorRange(:gradient=>'1', :minvalue=>'0', :code=>'FFFEC0', :endLabel=>'Peak Visits', :startLabel=>'Low') do
		xml.color(:code=>'C30000', :maxvalue=>'100') 
    end
	
end